package StringExercise;

import java.util.Arrays;

//拆分
public class SplitDemo1 {
    public static void main(String[] args) {
        String line1="abc12345fhgn324";
        String[] data1=line1.split("[0-9]+");
        System.out.println(Arrays.toString(data1));
        line1="..123.fsgf..452....";
        data1=line1.split("\\.");
        System.out.println(Arrays.toString(data1));
        System.out.println(data1.length);//6



        String line2="12acfhg465sdhs611";
        String[] data2=line2.split("[0-9]+");
        System.out.println(Arrays.toString(data2));
        line2="adsa..sds..123...";
        data2=line2.split("\\.");
        System.out.println(Arrays.toString(data2));
        System.out.println(data2.length);//5
    }
}
